<template>
  <h1>App</h1>
  <button @click="show = true">ShowHome</button>

  <Home v-if="show" />

  <About />
</template>

<script>
// 静态导入，导入所有模块都会被构建打包到主JS中
// import Home from "./components/Home.vue";

import { defineAsyncComponent } from "vue";
import About from "./components/About.vue";

export default {
  components: {
    Home: defineAsyncComponent(() => import("./components/Home.vue")),
    About,
  },

  data() {
    return {
      show: false,
    };
  },
};
</script>

<style></style>
